<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org"
>

<!--匹配 清吊-->

<head>

    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">

</head>
<style>
    .cx > div {
        margin-bottom: 10px;
    }
</style>
<body>

<div class="panel panel-default operation_dept" hidden>
    <div class="panel-heading title"></div>
    <div class="layui-card-body">
        <form class="layui-form layui-form-pane" action="" lay-filter="deptInfo" style="width: 700px;margin-top: 10px">
            <input name="id" hidden/>
            <input name="aid" hidden/>
            <div class="layui-form-item">
                <div class="layui-form-label ">企业名称</div>
                <div class="layui-input-block">
                    <input type="registration_authority" name="enterprise_name" placeholder="请输入企业名称" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-form-label ">统一社会信用代码</div>
                <div class="layui-input-block">
                    <input type="domination" name="social_credit_code" placeholder="请输入统一社会信用代码" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">法定代表人</label>
                <div class="layui-input-block">
                    <input type="address" name="legal_representative" placeholder="请输入法定代表人" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">经营场所</label>
                <div class="layui-input-block">
                    <input type="address" name="business_place" placeholder="请输入经营场所" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">经营范围</label>
                <div class="layui-input-block">
                    <input type="address" name="business_scope" placeholder="请输入经营范围" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">联系人</label>
                <div class="layui-input-block">
                    <input type="address" name="contacts" placeholder="请输入联系人" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">联系方式</label>
                <div class="layui-input-block">
                    <input type="address" name="contact_information" placeholder="请输入联系方式" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label ">状态</label>
                <div class="layui-input-block">
                    <input type="address" name="status" placeholder="请输入状态" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="submit">保存</button>
                    <button class="layui-btn layui-btn-primary" id="btn_cancel">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
<!--    左树-->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md4 layui-col-lg2">
            <div class="layui-card">
                <div class="layui-card-body mini-bar" id="leftTree">
                </div>
            </div>
        </div>
        <!--  ------------------------------表格  -->
        <div class="layui-col-sm12 layui-col-md8 layui-col-lg10">
            <!--     匹配报表   -->
            <div class="annual_table_div">
                <div id="searchAnnuals">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="a_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_registration_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入注册号">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_domination" class="layui-input" autocomplete="off"
                                   placeholder="请输入管辖机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_address" class="layui-input" autocomplete="off"
                                   placeholder="请输入地址">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_contact_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系电话">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_date_of_establishment"
                                   placeholder="请选择成立日期">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_approval_date" placeholder="请选择核准日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <input type="text" class="layui-input" id="a_enterprise_status" placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_liaison_man_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员姓名">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_liaison_man_phone" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员手机号码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_report_status">
                                <option value="0">请选择企业上报状态</option>
                                <option value="1">已上报</option>
                                <option value="2">未上报</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_enterprise_type">
                                <option value="0">请选择企业类型</option>
                                <option value="1">企业</option>
                                <option value="2">农合社</option>
                                <option value="3">个人</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_matching">
                                <option value="0">请选择匹配结果</option>
                                <option value="1">匹配成功</option>
                                <option value="2">匹配失败</option>
                            </select>
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchA()" id="searchAnnual">查询</button>
                        </div>
                    </div>
                </div>

                <!--                查询地址匹配度弹框-->
                <div class="matching-report" hidden>
                    <div style="height: 40px;background-color: #009688">
                        <span style="line-height: 40px;color: white;letter-spacing: 5px;margin-left: 5px">地址匹配度</span>
                        <a class="layui-btn" href="javascript:;" onclick="matchingClose()"
                           style="width: 40px;float: right">
                            <i style="margin-right: -8px;" class="layui-icon layui-icon-close"></i>
                        </a>
                    </div>
                    <div class="layui-input-inline layui-form" style="margin-top: 20px;margin-left: 25%;"
                         id="matchingDiv">
                    </div>

                </div>

                <table class="layui-table" id="annualsTable" lay-filter="annualsTable"></table>
            </div>
            <!--       清吊报表      -->
            <div class="revenue_table_div" hidden>
                <div id="searchParam">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="r_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_legal_representative" class="layui-input" autocomplete="off"
                                   placeholder="请输入法定代表人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_business_place" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营场所">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_business_scope" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营范围">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_contacts" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_contact_information" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系方式">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_enterprise_status" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="r_report_status">
                                <option value="0">请选择税务状态</option>
                                <option value="1">空号</option>
                                <option value="2">税务上报异常</option>
                                <option value="3">黑名单</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="r_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchR()" id="searchRevenue">查询</button>
                        </div>
                    </div>

                </div>
                <table class="layui-table" id="revenueTable" lay-filter="revenueTable"></table>
            </div>
        </div>


    </div>
</div>
<div id="deptTree" style="display: none"></div>
<script type="text/html" id="toolbar1">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">匹配信息
        </button>
        <!--        <button class="layui-btn layui-btn-sm" onclick="window.location.href = '/download/matchingDownload';" style="float: right;margin-right: -118px;" >下载</button>-->
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual" style="float: right;margin-right: -118px;">
            下载
        </button>

    </div>
</script>
<script type="text/html" id="toolbar2">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">清吊信息
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="add">添加</button>

        <!--        <button class="layui-btn layui-btn-sm" onclick="window.location.href = '/download/matchingDownloadEmpty';" style="float: right;margin-right: -118px;" >下载</button>-->
        <button class="layui-btn layui-btn-sm" lay-event="downloadRevenue" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="tool">
    <a class="layui-btn layui-btn-xs" lay-event="findHighMatchingAddress">匹配度</a>
    <a class="layui-btn layui-btn-xs" lay-event="changeMatchingStatus">确认</a>
</script>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script type="text/html" id="xuhao">
    {{d.LAY_TABLE_INDEX+1}}
</script>
<script>
    //获取token
    var token = CoreUtil.getData("access_token");
    //地址栏转义token中的#号
    var tokenQuery = token.replace("#", "%23");
    var tableIns1;
    var tableIns2;
    var tableIns3;
    var table = layui.table;
    var upload = layui.upload;
    var form = layui.form;
    var layer = layui.layer;
    var $ = jQuery = layui.jquery;
    var laydate = layui.laydate;
    var tree = layui.tree;
    var transfer = layui.transfer;
    var type1 = 'type1';
    //匹配报表
    var establishStartTimeMatching = null;
    var establishEndTimeMatching = null;
    var approvalStartTimeMatching = null;
    var approvalEndTimeMatching = null;
    var createStartTimeMatching = null;
    var createEndTimeMatching = null;
    //清吊报表
    var createStartTimeQingdiao = null;
    var createEndTimeQingdiao = null;
    layui.use(['table', 'layer', 'laydate', 'tree', 'transfer', 'upload'], function () {
        initLeftTree();
        tableIns1 = table.render({
            elem: '#annualsTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/matchingRpt/findAllMatchingReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar1'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {field: 'enterpriseName', title: '企业名称', width: 250},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 200},
                    {field: 'registrationNumber', title: '注册号', width: 150},
                    {field: 'domination', title: '管辖机关', width: 190},
                    {field: 'address', title: '地址', width: 250},
                    {field: 'contactNumber', title: '联系电话', width: 125},
                    {
                        field: 'establishDate', title: '成立日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.establishDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'approvalDate', title: '核准日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.approvalDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {field: 'enterpriseStatus', title: '状态', width: 60},
                    {field: 'liaisonManName', title: '联络员姓名', width: 100},
                    {field: 'liaisonManPhone', title: '联络员电话', width: 125},
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'reportStatus', title: '上报状态', width: 90, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '已上报';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '未上报';
                            }
                        }
                    },
                    {
                        field: 'enterpriseType', title: '企业类型', width: 90, templet: function (item) {
                            if (item.enterpriseType === 1 || item.enterpriseType === "1") {
                                return '企业';
                            }
                            if (item.enterpriseType === 2 || item.enterpriseType === "2") {
                                return '农合社';
                            }
                            if (item.enterpriseType === 3 || item.enterpriseType === "3") {
                                return '个人';
                            }
                        }
                    },
                    {
                        field: 'matchingResult', title: '匹配结果', width: 90, templet: function (item) {
                            if (item.matchingResult === 1 || item.matchingResult === "1") {
                                return '匹配成功';
                            }
                            if (item.matchingResult === 2 || item.matchingResult === "2") {
                                return '匹配失败';
                            }
                        }
                    },
                    {title: '操作', toolbar: '#tool', minWidth: 130}
                ]
            ]
        });

        tableIns3 = table.render({
            elem: '#revenueTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/qingdiaoRpt/findAllQingDiaoReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar2'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {field: 'enterpriseName', title: '企业名称', width: 250},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 200},
                    {field: 'legalRepresentative', title: '法定代表人', width: 100},
                    {field: 'businessPlace', title: '经营场所', width: 200},
                    {field: 'businessScope', title: '经营范围', width: 200},
                    {field: 'contacts', title: '联系人', width: 80},
                    {field: 'contactInformation', title: '联系方式', width: 125},
                    {field: 'status', title: '状态', width: 60},
                    {
                        field: 'reportStatus', title: '税务状态', width: 120, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '空号';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '税务上报异常';
                            }
                            if (item.reportStatus === 3 || item.reportStatus === "3") {
                                return '黑名单';
                            }
                        }
                    },
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });

        //操作项事件
        table.on('tool(annualsTable)', function (obj) {
            console.log(obj, 111);
            var data = obj.data;
            var id = data.id;
            switch (obj.event) {
                case 'changeMatchingStatus':
                    console.log('确认' + id);
                    changeMatchingStatus(id);
                    break;
                case 'findHighMatchingAddress':
                    matchingReport();
                    console.log('匹配度' + id);
                    findHighMatchingAddress(id);
                    break;
            }
        });

        /**
         * 手动修改匹配状态，将失败修改为成功
         */
        var changeMatchingStatus = function (id) {
            layer.open({
                content: '确定要修改正确吗？',
                yes: function (index, layero) {
                    layer.close(index); //如果设定了yes回调，需进行手工关闭
                    CoreUtil.sendPost("/matchingRpt/changeMatchingStatus", id, function (res) {
                        if (res.data == "1") {
                            layer.msg('修改成功！', {}, function () {
                                search();
                            });
                        } else {
                            layer.msg('修改失败！', {}, function () {
                                search();
                            });
                        }
                    });
                }
            })
        };

        /**
         * 查询地址匹配度
         */
        var findHighMatchingAddress = function (id) {
            CoreUtil.sendPost("/matchingRpt/findHighMatchingAddress", id, function (res) {
                console.log(res);
                var data = res.data;
                if (data == 2) {
                    $("#matchingDiv").html("<div>没有相关匹配度的地址！</div>");
                } else {
                    var html = "<div>地址：" + data[0].address + "，匹配度：" + data[0].degree + "</div>";
                    $("#matchingDiv").html(html);
                    search();
                }
            });
        };

        /**
         * 点击匹配度弹出查询地址匹配度框
         */
        var matchingReport = function () {
            $(".matching-report").show();
        };

        //添加
        table.on('toolbar', function (obj) {
            console.log("sddsad");
            switch (obj.event) {
                case 'add':
                    $(".revenue_table_div").hide();
                    $("#leftTree").hide();
                    $(".operation_dept").show();
                    $(".title").html("新增空号企业信息");
                    $(".operation_dept input[name=enterprise_name]").val("");
                    $(".operation_dept input[name=social_credit_code]").val("");
                    $(".operation_dept input[name=legal_representative]").val("");
                    $(".operation_dept input[name=business_place]").val("");
                    $(".operation_dept input[name=business_scope]").val("");
                    $(".operation_dept input[name=contacts]").val("");
                    $(".operation_dept input[name=contact_information]").val("");
                    $(".operation_dept input[name=status]").val("");
                    var x = document.getElementsByClassName("layui-unselect layui-form-switch");
                    x[0].setAttribute("class", "layui-unselect layui-form-switch layui-form-onswitch");
                    var d = document.getElementsByTagName('em')[0];
                    d.firstChild.nodeValue = '启用';
                    form.render(); //更新全部
                    break;
                case 'downloadRevenue':
                    console.log("aaaaaaaaa");
                    downloadRevenue();
                    break;
                case 'downloadAnnual':
                    downloadAnnual();
                    break;
            }
        });

        /**
         * 用户新增修改的提交按钮
         * 通过id是否为空判断调用不同的接口
         */
        form.on('submit(submit)', function (data) {
            console.log(data);
            CoreUtil.sendPost("/qingdiaoRpt/addQingDiaoReportForEmpty", data.field, function (res) {
                if (res.data == "1") {
                    layer.msg('添加成功！', {}, function () {
                        $(".dept-table").show();
                        $(".operation_dept").hide();
                        location.reload();
                    });
                } else {
                    layer.msg('添加失败！', {}, function () {
                        $(".dept-table").show();
                        $(".operation_dept").hide();
                        location.reload();
                    });
                }
            });

            return false;
        });

        /**
         * 返回按钮
         */
        $("#btn_cancel").click(function () {
            $(".layui-col-lg10").show();
            $(".operation_dept").hide();
            return false;
        });

        /**
         * 匹配下载按钮调用接口
         */
        var downloadAnnual = function () {
            window.location.href = "/download/matchingDownload";
            // CoreUtil.downloadExcel("/download/matchingDownload", {}, function (res) {
            //     console.log(res);
            // });



        };

        /**
         * 清吊下载按钮调用接口
         */
        var downloadRevenue = function () {
            window.location.href = "/download/matchingDownloadEmpty";
            // CoreUtil.sendPost("/download/download", {}, function (res) {
            //     console.log(res);
            // });
        };

        function initLeftTree() {
            var data1 = [{
                title: '默认信息',
                id: 1,
                label: '默认信息',
                spread: true,
                disabled: true,
                checked: false,
                children: [{
                    title: '匹配信息',
                    id: 1,
                    label: '匹配信息',
                    spread: true,
                    enterpriseType: 1,
                    disabled: false,
                    type: 'type1'
                }, {
                    title: '清吊信息',
                    id: 3,
                    label: '清吊信息',
                    spread: true,
                    enterpriseType: 3,
                    disabled: false,
                    type: 'type3'
                }]
            }];
            tree.render({
                elem: '#leftTree'
                , data: data1
                , onlyIconControl: true  //是否仅允许节点左侧图标控制展开收缩
                , click: function (obj) {
                    console.log(obj, 456);
                    type1 = obj.data.type;
                    // deptNo = obj.data.deptNo;
                    $("#leftTree span").removeClass('custom-tree-item-clicked');     //清除旧的样式
                    $("#leftTree span:contains(" + obj.data.title + ")").addClass('custom-tree-item-clicked');
                    if (obj.data.id == 1) {
                        $(".annual_table_div").show();
                        $(".revenue_table_div").hide();
                    }
                    if (obj.data.id == 3) {
                        $(".annual_table_div").hide();
                        $(".revenue_table_div").show();
                    }
                }
            });
        }

        /**
         * 切换按钮时修改当前的value值
         */
        form.on('switch(jobSwitch)', function () {
            $(".operation_dept input[name=enterprise_status]").attr('type', 'hidden').val(this.checked ? 1 : 2);
        });

    });

    /**
     * 设置日期
     */
    laydate.render({
        elem: '#a_date_of_establishment'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                establishStartTimeMatching = value.split("~")[0];
                establishEndTimeMatching = value.split("~")[1];
            } else {
                establishStartTimeMatching = null;
                establishEndTimeMatching = null;
            }

        }
    });
    laydate.render({
        elem: '#a_approval_date'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                approvalStartTimeMatching = value.split("~")[0];
                approvalEndTimeMatching = value.split("~")[1];
            } else {
                approvalStartTimeMatching = null;
                approvalEndTimeMatching = null;
            }

        }
    });
    laydate.render({
        elem: '#a_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeMatching = value.split("~")[0];
                createEndTimeMatching = value.split("~")[1];
            } else {
                createStartTimeMatching = null;
                createEndTimeMatching = null;
            }

        }
    });
    laydate.render({
        elem: '#r_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeQingdiao = value.split("~")[0];
                createEndTimeQingdiao = value.split("~")[1];
            } else {
                createStartTimeQingdiao = null;
                createEndTimeQingdiao = null;
            }

        }
    });

    /**
     * 隐藏弹出框
     */
    function matchingClose() {
        $(".matching-report").hide();
    }

    /**
     * 条件查询按钮方法
     * 匹配信息
     */
    function searchA() {
        //这里以搜索为例
        tableIns1.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#a_enterprise_name").val(),
                socialCreditCode: $("#a_social_credit_code").val(),
                registrationNumber: $("#a_registration_number").val(),
                registrationAuthority: $("#a_registration_authority").val(),
                domination: $("#a_domination").val(),
                address: $("#a_address").val(),
                contactNumber: $("#a_contact_number").val(),
                establishStartTime: establishStartTimeMatching,
                establishEndTime: establishEndTimeMatching,
                approvalStartTime: approvalStartTimeMatching,
                approvalEndTime: approvalEndTimeMatching,
                enterpriseStatus: $("#a_enterprise_status").val(),
                liaisonManName: $("#a_liaison_man_name").val(),
                liaisonManPhone: $("#a_liaison_man_phone").val(),
                createStartTime: createStartTimeMatching,
                createEndTime: createEndTimeMatching,
                reportStatus: $("#a_report_status").val(),
                enterpriseType: $("#a_enterprise_type").val(),
                matchingResult: $("#a_matching").val()
                // deptNo: deptNo
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    /**
     * 条件查询按钮方法
     * 清吊信息
     */
    function searchR() {
        //这里以搜索为例
        tableIns3.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#r_enterprise_name").val(),
                socialCreditCode: $("#r_social_credit_code").val(),
                legalRepresentative: $("#r_legal_representative").val(),
                businessPlace: $("#r_business_place").val(),
                businessScope: $("#r_business_scope").val(),
                contacts: $("#r_contacts").val(),
                contactInformation: $("#r_contact_information").val(),
                status: $("#r_status").val(),
                reportStatus: $("#r_report_status").val(),
                createStartTime: createStartTimeQingdiao,
                createEndTime: createEndTimeQingdiao
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    function search() {
        // //这里以搜索为例
        // tableIns3.reload({
        //     where: { //设定异步数据接口的额外参数，任意设
        //         enterpriseName: $("#r_enterprise_name").val(),
        //         socialCreditCode: $("#r_social_credit_code").val(),
        //         legalRepresentative: $("#r_legal_representative").val(),
        //         businessPlace: $("#r_business_place").val(),
        //         businessScope: $("#r_business_scope").val(),
        //         contacts: $("#r_contacts").val(),
        //         contactInformation: $("#r_contact_information").val(),
        //         status: $("#r_status").val(),
        //         reportStatus: $("#r_report_status").val(),
        //         createStartTime: createStartTimeQingdiao,
        //         createEndTime: createEndTimeQingdiao
        //     }
        //     , page: {
        //         curr: 1 //重新从第 1 页开始
        //     }
        // });
    }


</script>
</body>
</html>